package org.zwd.computePrice.domain;

import java.text.DecimalFormat;

public class Crab {
	private int id; 
	private String name;
	private CrabPrice crabPrice;
	private String note;
	private double number;
	private int totalPrice;
	private String numberStr;
	
	private int ismale;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public CrabPrice getCrabPrice() {
		return crabPrice;
	}
	public void setCrabPrice(CrabPrice crabPrice) {
		this.crabPrice = crabPrice;
	}
	public int getIsmale() {
		return ismale;
	}
	public void setIsmale(int ismale) {
		this.ismale = ismale;
	}
	
	public double getNumber() {
		return number;
	}
	public void setNumber(double number) {
		this.number = number;
	}
	public int getTotalPrice() {
		double sum = number*crabPrice.getPrice();
		totalPrice = (int)sum; 
		return totalPrice;
	}
	
	public String getNumberStr() {
		DecimalFormat df = new DecimalFormat("###,###.0");
		numberStr = df.format(this.number);
		return numberStr;
	}
	
	@Override
	public String toString() {
		return "Crab [id=" + id + ", name=" + name + ", crabPrice=" + crabPrice + ", note=" + note + ", number="
				+ number + ", totalPrice=" + totalPrice + ", ismale=" + ismale + "]";
	}
	
}
